﻿<%@ page import="com.tangdi.merchantsign.TdMerSign"%>
<%@ page import="com.demo.Test.TdRaAndCaUtil"%>
<%--
 Created by Intell IDEA.
 User: Bluewater
 Date: 2011-7-21
 Time: 20:55:45
 To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%
    //字符编码
    String CharacterEncoding = "UTF-8";
    request.setCharacterEncoding(CharacterEncoding);
    //MERNO=00000000000094&ORDNO=914444444&REGAMT=1&CUSTNO=00000100000125&RSPCOD=00000&RSPMSG=交易成功&nqkHwgkRdWy5

    		
    String Merno = request.getParameter("MERNO");
    String Ordno = request.getParameter("ORDNO");
    String Txamt = request.getParameter("TXAMT");
    String Custno = request.getParameter("CUSTNO");
    String Signdate = request.getParameter("SIGNDATA");
	String str = "MERNO="+Merno+"&ORDNO="+Ordno+"&TXAMT="+Txamt+"&CUSTNO="+Custno+"&nqkHwgkRdWy5";
	String SIGNDATA2=TdRaAndCaUtil.HKMD5(str);
    System.out.println("Merno"+Merno);
    System.out.println("Ordno"+Ordno);
    System.out.println("Txamt"+Txamt);
    System.out.println("Custno"+Custno);
    System.out.println("SIGNDATA"+Signdate);
    if(SIGNDATA2.equals(Signdate)){
    	System.out.println("成功");
    }else{
    	System.out.println("失败");

    }
	
  
%>

<html>
<head>
<title>Payment Result</title>
</head>

<body>
	<!-- 请加上你们网站的框架。就是你们网站的头部top，左部left等。还有字体等你们都要做调整。 -->

	<%
 if (Merno=="00000000000094"){
 %>
	<!-- MD5验证成功 -->
	<table width="728" border="0" cellspacing="0" cellpadding="0"
		align="center">
		<tr>
			<td align="right" valign="top" width="200">Your order number is：</td>
			<td align="left" valign="top"><%= Prdordno%></td>
		</tr>
		<tr>
			<td align="right" valign="top">Ordamt：</td>
			<td align="left" valign="top"><%= Ordamt%></td>
		</tr>
		<tr>
			<td align="right" valign="top">Payment result：</td>
			<%if ( ordStatus=="1" ) 
	{
	%><!-- 扣款成功 -->
			<td align="left" valign="top" style="color: green;"><%= ordStatus%></td>
			<%
	}
	else
	{
	%><!-- 扣款失败 -->
			<td align="left" valign="top" style="color: red;"><%= ordStatus%>&nbsp;&nbsp;&nbsp;&nbsp;<%= ordStatus%></td>
			<%
	}%>
		</tr>

	</table>
	<%
}
else 
{
%>
	<!-- MD5验证失败 -->
	<table width="728" border="0" cellspacing="0" cellpadding="0"
		align="center">
		<tr>
			<td align="center" valign="top" style="color: red;">Validation
				failed!</td>
		</tr>
	</table>
	<%	
}
 %>
</body>

</html>

